package org.leon;

import org.leon.pojo.SimpleBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnClass
public class SimpleAutoConfiguration {

    @Autowired
    private SimpleProperty simpleProperty;

    static {
        System.out.println("SimpleAutoConfiguration init ...");
    }

    @Bean
    public SimpleBean simpleBean() {
        return new SimpleBean(simpleProperty.getId(), simpleProperty.getName());
    }
}
